Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Movie Functions


NewMovie

The NewMovie function creates a new movie in memory. The Movie Toolbox
initializes the data structures for the new movie, which contains no tracks. Your application assigns the data to the movie by calling the functions that are described later in "Creating Tracks and Media Structures" beginning on page 2-136.

pascal Movie NewMovie (long newMovieFlags);
newMovieFlags
Specifies control information for the new movie. The following flags are available (be sure to set unused flags to 0):
newMovieActive
Controls whether the new movie is active. Set this flag to 1 to make the new movie active. A movie that does not have any tracks can still be active. When the Movie Toolbox tries to play the movie, no images are displayed, because there is no movie data. You can make a movie active or inactive by calling the SetMovieActive function, which is described on page 2-131.
newMovieDontAutoAlternate
Controls whether the Movie Toolbox automatically selects enabled tracks from alternate track groups. If you set this flag to 1, the Movie Toolbox does not automatically select tracks for the movie--you must enable tracks yourself.
DESCRIPTION
The NewMovie function returns the identifier for the new movie. If the function fails, the returned identifier is set to nil. Use the GetMoviesError function (described on page 2-73) to obtain the result code.

The Movie Toolbox sets many movie characteristics to default values. If you want to change these defaults, your application must call other Movie Toolbox functions. For example, the Movie Toolbox sets the movie's graphics world to the one that is active when you call NewMovie. To change the graphics world for the new movie, your application should use the SetMovieGWorld function, which is described on page 2-145.

The default QuickTime movie time scale is 600 units per second; however, this number may change in the future. The default time scale was chosen because it is convenient for working with common video frame rates of 30, 25, 24, 15, 12, 10, and 8.

You should use the NewMovie function only if you have not created a new movie and movie file by calling the CreateMovieFile function.

WARNING
The Movie Toolbox automatically sets the movie's graphics world based upon the current graphics port. Be sure that your application's graphics port is valid before you call this function.
ERROR CODES
movieToolboxUninitialized-2020You haven't initialized the Movie Toolbox
Memory Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996